/**
 * Created by Yao on 2017/10/14.
 */
function area(chartFilter, areaChartData) {

    var chartCanvas = $(chartFilter).get(0).getContext('2d');
    var areaChart = new Chart(chartCanvas);
    var areaChartOptions = {
        showScale: true,
        scaleShowGridLines: false,
        scaleGridLineColor: 'rgba(0,0,0,.05)',
        scaleGridLineWidth: 1,
        scaleShowHorizontalLines: true,
        scaleShowVerticalLines: true,
        bezierCurve: true,
        bezierCurveTension: 0.3,
        pointDot: false,
        pointDotRadius: 4,
        pointDotStrokeWidth: 1,
        pointHitDetectionRadius: 20,
        datasetStroke: true,
        datasetStrokeWidth: 2,
        datasetFill: true,
        legendTemplate: '<ul class="<%="111".toLowerCase()%>-legend"><% for (int i=0; i<data.size(); i++){%><li><span style="background-color:<%=data.get(i).getFillColor()%>"></span><%=data.get(i).getLabel()%></li><%}%></ul>',
        maintainAspectRatio: true,
        responsive: true,
    };

    areaChart.Line(areaChartData, areaChartOptions)
}


function bar(chartFilter, areaChartData) {

    var barChartCanvas = $(chartFilter).get(0).getContext('2d');
    var barChart = new Chart(barChartCanvas);
    var barChartData = areaChartData;
    var barChartOptions = {
        scaleBeginAtZero: true,
        scaleShowGridLines: true,
        scaleGridLineColor: 'rgba(0,0,0,.05)',
        scaleGridLineWidth: 1,
        scaleShowHorizontalLines: true,
        scaleShowVerticalLines: true,
        barShowStroke: true,
        barStrokeWidth: 2,
        barValueSpacing: 5,
        barDatasetSpacing: 1,
        // legendTemplate: '<ul class="<%=name.toLowerCase()%>-legend"><% for (int i=0; i<data.size(); i++){%><li><span style="background-color:<%=data.get(i).getFillColor()%>"><%=data.get(i).getLabel()%></span></li><%}%></ul>',
        legendTemplate: '<ul class="<%=name.toLowerCase()%>-legend"><% for (int i=0; i<data.size(); i++){%><li><span style="background-color:<%=data.get(i).getFillColor()%>">111</span></li><%}%></ul>',
        // legendTemplate: '1111111111',
        responsive: true,
        maintainAspectRatio: true,
        datasetFill: false,
    };
    barChart.Bar(barChartData, barChartOptions);
}